<template>
  <button @click="increment">
      Count值是：{{ count }}, doubleCount值是：{{ doubleCount }}
  </button>
  {{ count }}
</template>

<script>
import { reactive, toRefs } from '@vue/reactivity'
import { computed } from '@vue/runtime-core'
export default {
    setup () {
        const state = reactive({
            count: 0,
            doubleCount: computed(() => state.count * 2)
        })

        const increment = () => {
            state.count++
        }

        return {
            state,
            increment
        }
    }
}
</script>

<style>

</style>